<?php
namespace app\controller;

use app\BaseController;
use think\facade\Db;

class Index extends BaseController
{
    
    public function index()
    {
        $temperature= request()->param('temperature');
        $d=date('Y-m-d');
        $t=date('H:i:s');

        $dataarr=[
            'date'=>$d,
            'time'=>$t,
            'temperature'=>$temperature
        ];
        Db::name('temperature')->save($dataarr);

        //$res=Db::table('temperature')->select();
        return 'ok';
       
    }

    public function hello($name = 'ThinkPHP6')
    {
        return 'hello,' . $name;
    }
}
